package com.ptms.controller;

import com.ptms.dto.CampusSelectDTO;
import com.ptms.service.CampusService;
import com.ptms.vo.ResultVO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/campus")  // 假设全局前缀是/api
@RequiredArgsConstructor
public class CampusController {

    private final CampusService campusService;

    // 获取所有校区（供注册时选择）
    @GetMapping("/list")
    public ResultVO<List<CampusSelectDTO>> getAllCampuses() {
        return campusService.getAllCampuses();
    }
}